{% extends "messages/base.html" %} 

{% load i18n %} 
{% load oembed_tags %}
{% load timezone_filters %}

{% block body %}
    <h1>{% trans "View Message" %}</h1>
    
    <dl class="message-headers">
        <dt>{% trans "Sender" %}:</dt>
        <dd><a href="{% url profiles.views.profile message.sender %}">{{ message.sender }}</a></dd>
        <dt>{% trans "Subject" %}:</dt>
        <dd><strong>{{ message.subject }}</strong></dd>
        <dt>{% trans "Date" %}:</dt>
        <dd>{{ message.sent_at|localtime:user.get_profile.timezone|date:_("DATETIME_FORMAT")}}</dd>
        <dt>{% trans "Recipient" %}:</dt>
        <dd>{{ message.recipient }}</dd>
    </dl>
    
    <p>{% oembed %}{{ message.body|linebreaksbr }}{% endoembed %}</p>
    
    {% ifequal message.recipient user %}
        <p><a href="{% url messages_reply message.id %}">{% trans "Reply" %}</a></p>
    {% endifequal %}
    
    <p><a href="{% url messages_delete message.id %}">{% trans "Delete" %}</a></p>
{% endblock %}